#include "uiDraw.h"

Ship::Ship()
{
   vThrust.setX(0);
   vThrust.setY(0);
   shipAngle  = 0;
}

void Ship::event(int up, int left, int right)
{
   shipAngle = shipAngle +
               (left  * 10)
               -
               (right * 10);

   if (up)
   {
      vThrust.setAngle(shipAngle);
      vThrust.setSpeed(0.2);
      vThrust += vThrust;
   }
}

void Ship::draw()
{
   drawShip(vThrust.getPoint(), shipAngle);
}
